<template>
<!--    管理中心-->
    <div>
        <school v-if="!flag"></school>
        <administrator v-if="flag"></administrator>
    </div>
</template>

<script>
    import school from '../components/school'
    import administrator from  '../components/administrator'
    import {getuser} from "../api/api";
    export default {
        name: "management",
        components:{
            school,
            administrator
        },
        data(){
            return{
                flag:true
            }
        },
        created() {
            getuser().then(res=>{
                console.log(res)
                if(res.status == 0){
                    if(res.data.type == 1){
                        this.flag = false
                    }else {
                        this.flag = true
                    }
                }
            })
        }
    }
</script>

<style scoped>

</style>
